<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>{{$title}}</title>
<link rel="stylesheet" href="/css/style.css">
<script src="/js/jquery-2.1.4.min.js"></script>
<script src="/js/laydate.js"></script>
</head>
<style type="text/css">
	#weiguineir,.chuna,#chrye{
	}
	.prd{
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.push_button{
  background: #ededed;
  background-image: -webkit-linear-gradient(top, #ededed, #bab1ba);
  background-image: -moz-linear-gradient(top, #ededed, #bab1ba);
  background-image: -ms-linear-gradient(top, #ededed, #bab1ba);
  background-image: -o-linear-gradient(top, #ededed, #bab1ba);
  background-image: linear-gradient(to bottom, #ededed, #bab1ba);
  -webkit-border-radius: 15;
  -moz-border-radius: 15;
  border-radius: 15px;
  text-shadow: 0px 1px 0px #e1e2ed;
  -webkit-box-shadow: 3px 4px 0px 0px #899599;
  -moz-box-shadow: 3px 4px 0px 0px #899599;
  box-shadow: 3px 4px 0px 0px #899599;
  font-family: Arial;
  color: #3a8a9e;
  font-size: 16px;
  padding: 12px 30px 12px 30px;
  border: solid #d6bcd6 1px;
  text-decoration: none;
  margin: 15px;
}
.heading{
	margin: 5px;
}
.push_button:hover {
  color: #3a8a9e;
  background: #bab1ba;
  text-decoration: none;
} 
.ha{
	width:100%;
}
.chryec,.dcontent{
	display: none;
}
</style>
<body style="background: #F2F2F2;">
	<form action="/ninecheck/create" method="post">
		{{ csrf_field() }}
		<input type="hidden" name="groupId" value="{{$groupId}}">
<ul class="noaccordww">
	<?php $i=1; ?>
	@foreach ($entrys as $entry)
		<li>
			<div><span>{{$i}}.{{$entry->entry}}</span></div>
			<input type="hidden" name="entryId[{{$i}}]" value="{{$entry->id}}" class="inputIDs">
			
			<!--<div><a class="drfa3" href="javascript:void(0)">不涉及</a>
			<a class="drfa2" href="javascript:void(0)" id="ClickMe2">否</a>
			<a class="drfa1 xuanzhong" href="javascript:void(0)" id="ClickMe2">是</a>
			<h1 style="display: none;" class="weigner gieo" style="cursor:pointer">选择隐患</h1>
			
				
			<input class="chryec-s" type="hidden" name="status[{{$i}}]" value="1">
			</div>-->
			
			
			<div id="dcontent" class="dcontent" style="display: block;">
					<p style="display: none;" class="heading">上传文件列表：</p>
					<ul id="files" style="text-align:left;display: none;">
						
					</ul>
					<div class="turae"></div>
					<input class="chryec" style="margin: 16px 3%;display: block;" type="text" name="content[{{$i}}]" placeholder="隐患补充描述">
					<table>
						<tbody>
							<tr class="ha">
								
								<td><div class="push_button" onclick="appendByCamera()">拍照</div></td>
								<td><div class="push_button" onclick="appendByGallery()">相册</div></td>
								<td><div name="picture[{{$i}}]" class="push_button" onclick="upload(this,{{$i}})">上 传</div>
								</td>	
							</tr>
							<input type="hidden" name="picture[{{$i}}]" id="img{{$i}}" value="" />
							<tr class="ha">
							</tr>
						</tbody>
					</table>
			</div>
		</li>
		<?php $i++; ?>
		@endforeach

		
	</ul>

		<input type="submit" class="qrtj dibuann" value="下一步">
	</form>
	

	
	
	
	<!--提交？-->
	<script type="text/javascript">
		var checkid;
		var checkidde;
		
		$('#shezhi').click(function sel() {

	
	
var xuanzhongde = $(this).parents("form").children('div').children('p').attr("data-check")
        	console.log(xuanzhongde)
			// 提交
			var arr = [];
			var xuanzhong = [];
			for (var i=0;i<$("#form1 .pItem p").length;i++){
				if($("#form1 .pItem p").eq(i).attr("class") == "act"){
					var ids = $("#form1 .pItem p").eq(i).attr("data-id")
					var iue = $("#form1 .pItem p").eq(i).text()
					if(!check) {
						var check = $("#form1 .pItem p").eq(i).attr("data-check")
					}
					arr.push(ids)
					xuanzhong.push(iue)
					
				}
			}
console.log(arr)
			$(".noaccordww").append("<input class='e"+check+"' name='negative["+check+"]' value ='"+arr.join(',')+",'  type='hidden' >");
			$('#code22').hide();
	        $('#goodcover2').hide();
				// ajax 提交数据
				
				
//				显示数据

//alert(checkid)
//每个大类的id
//alert(checkidde)
//点击的他自己这个违规选项的元素
//alert(xuanzhong)
//选中的违规项的内容
if(checkidde.children("h1.prd")!=""){
	checkidde.children("h1.prd").remove()}

for (var i=0;i<xuanzhong.length;i++){
//	alert(checkidde.attr("class"))
	

	checkidde.siblings(".dcontent").children(".turae").append("<h1 class='weigner prd' data-id='"+1+"'>"+xuanzhong[i]+"</h1>")

		}	
       })
        
        
        
        
        
        
        function play() {
        	console.log();
        	var cont=document.getElementById("ClickMe2");
  			console.log('innerHtml cont= '+ cont.innerHTML);
        }
    </script>
	
	
	

	
	
	

	<script type="text/javascript">
		var server="http://book.ccshe.com/upload/uploadimg";
		var files=[];
		// 上传文件
		function upload(a,b){
			
			if(files.length<=0){
				plus.nativeUI.alert("没有添加上传文件！");
				return;
			}
			
			var wt=plus.nativeUI.showWaiting();
			var task=plus.uploader.createUpload(server,
					{method:"POST"},
					function(t,status){ //上传完成
						var rsult=JSON.parse(t.responseText);
	
						if(status==200){								
							var yu='img'+b;
							var td = a.parentNode;
							var tr = td.parentNode;
							var newImg = document.createElement("img");  
							//document.getElementByname('img').value += rsult.data + ',';
							document.getElementById(yu).value += rsult.data + ',';
							newImg.src = rsult.data; 
							
							tr.appendChild(newImg); 
							
							wt.close();
						}else{
							outLine("上传失败："+status);
							wt.close();
						}
					}
				);
			task.addData("client","HelloH5+");
			task.addData("uid",getUid());
			for(var i=0;i<files.length;i++){
				var f=files[i];
				task.addFile(f.path,{key:f.name});
			}
			task.start();
			files=[];
		}
		// 拍照添加文件
		function appendByCamera(){
			plus.camera.getCamera().captureImage(function(p){
				appendFile(p);
			});	
		}
		// 从相册添加文件
		function appendByGallery(){
			plus.gallery.pick(function(p){
		        appendFile(p);
		    });
		}
		// 添加文件
		var index=1;
		function appendFile(p){
			var fe=document.getElementById("files");
			var li=document.createElement("li");
			var n=p.substr(p.lastIndexOf('/')+1);
			li.innerText=n;
			fe.appendChild(li);
			files.push({name:"fileImg",path:p});
			index++;
			empty.style.display="none";
		}
		// 产生一个随机数
		function getUid(){
			return Math.floor(Math.random()*100000000+10000000).toString();
		}
		</script>
</body>
</html>